//
//  BHUserInfoWriteCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/16.
//

import UIKit

class BHUserInfoWriteCell: UITableViewCell {
    var infoTextDidEndEditingBlock:((String) -> Void)?

    @IBOutlet weak var name_label: UILabel!
    
    @IBOutlet weak var infoTextFiled: UITextField!
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.infoTextFiled.delegate = self
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        
    }
    
}

extension BHUserInfoWriteCell: UITextFieldDelegate {
    func textFieldDidEndEditing(_ textField: UITextField) {
        self.infoTextDidEndEditingBlock?(textField.text ?? "")
    }
    
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        return true
    }
}
